package com.guigu.gulicommon.exception;

import com.guigu.gulicommon.api.BaseResCode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class BaseException extends RuntimeException {

    private Integer code;

    public BaseException(BaseResCode resCode) {
        super(resCode.getMsg());
        this.code = resCode.getCode();
    }

    public BaseException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}